package cn.lingyangwl.agile.infra.datamanage.service;


import cn.lingyangwl.agile.infra.datamanage.mode.entity.DatasourceConfig;
import cn.lingyangwl.agile.infra.datamanage.mode.rqrs.DatasourceConfigQuery;
import cn.lingyangwl.agile.infra.datamanage.mode.rqrs.DatasourceResp;
import cn.lingyangwl.agile.infra.datamanage.mode.rqrs.DbTableReq;
import cn.lingyangwl.agile.infra.module.datamanage.db.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author shenguangyang
 */
public interface DatasourceService extends IService<DatasourceConfig> {

    List<DatasourceResp> listAll();

    void update(DatasourceConfig datasourceConfig);

    void delete(DatasourceConfig datasourceConfig);

    IPage<DatasourceConfig> page(DatasourceConfigQuery req);

    List<TableDefinition> listTable(DbTableReq req);

    void deleteBatchByIds(List<Long> ids);

    /**
     * 获取sql上下文
     */
    List<SQLContext> listSqlContext(Long datasourceId, List<String> tableNames);
}
